<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Free all session variables</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.session-unregister.html">session_unregister</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.session-write-close.html">session_write_close</a></div>
 <div class="up"><a href="ref.session.html">Session 函数</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="function.session-unset" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">session_unset</h1>
  <p class="verinfo">(PHP 4, PHP 5)</p><p class="refpurpose"><span class="refname">session_unset</span> &mdash; <span class="dc-title">Free all session variables</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-function.session-unset-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="type"><span class="type void">void</span></span> <span class="methodname"><strong>session_unset</strong></span>
    ( <span class="methodparam">void</span>
   )</div>

  <p class="para rdfs-comment">
   The <span class="function"><strong>session_unset()</strong></span> function frees all session variables
   currently registered.
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.session-unset-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   没有返回值。
  </p>
 </div>


 <div class="refsect1 notes" id="refsect1-function.session-unset-notes">
  <h3 class="title">注释</h3>
  <blockquote class="note"><p><strong class="note">Note</strong>: 
   <p class="para">
    If <var class="varname"><var class="varname"><a href="reserved.variables.session.html" class="classname">$_SESSION</a></var></var> (or <var class="varname"><var class="varname">$HTTP_SESSION_VARS</var></var>
    for PHP 4.0.6 or less) is used, use <span class="function"><a href="function.unset.html" class="function">unset()</a></span> to
    unregister a session variable, i.e.
    <em>unset ($_SESSION[&#039;varname&#039;]);</em>.
   </p>
  </p></blockquote>
  <div class="caution"><strong class="caution">Caution</strong>
   <p class="para">
    Do NOT unset the whole <var class="varname"><var class="varname"><a href="reserved.variables.session.html" class="classname">$_SESSION</a></var></var> with
    <em>unset($_SESSION)</em> as this will disable the registering
    of session variables through the <var class="varname"><var class="varname"><a href="reserved.variables.session.html" class="classname">$_SESSION</a></var></var> superglobal.
   </p>
  </div>
 </div>


</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.session-unregister.html">session_unregister</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.session-write-close.html">session_write_close</a></div>
 <div class="up"><a href="ref.session.html">Session 函数</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
